bitkeeper revision 1.1159.212.8 (41ddcdedA_y3YPCIz7quwuaHg2Lhng)
authoriap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk>
Thu, 6 Jan 2005 23:46:53 +0000 (23:46 +0000)
committeriap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk>
Thu, 6 Jan 2005 23:46:53 +0000 (23:46 +0000)
VMX bug fixes.

xen/arch/x86/vmx.c
xen/arch/x86/x86_32/entry.S

index 53f564358019451fa21e5fa98632cc634d613ed5..f69002f4ed9126fd74191be58f9ecb8c22fdcac7 100644 (file)
@@ -75,7 +75,7 @@ int start_vmx()
 
 void stop_vmx()
 {
-    if (test_bit(X86_FEATURE_VMXE, &boot_cpu_data.x86_capability))
+    if (read_cr4() & X86_CR4_VMXE)
         __vmxoff();
 }
 
index b111e0c12a05e68e0127a63bf1ea361b3ec77e8a..129c3149993232156016d7ba1aaad26d7ffc024d 100644 (file)
  *
  * We also need the room, especially because orig_eax field is used 
  * by do_IRQ(). Compared the xen_regs, we skip pushing for the following:
- * (1/1)  u16 error_code;
- * (2/1)  u16 entry_vector;
- *   (2)  u32 eip;
- *   (3)  u32 cs;
+ *   (10) u32 gs;                 
+ *   (9)  u32 fs;
+ *   (8)  u32 ds;
+ *   (7)  u32 es;
+ *               <- get_stack_top() (= HOST_ESP)
+ *   (6)  u32 ss;
+ *   (5)  u32 esp;
  *   (4)  u32 eflags;
+ *   (3)  u32 cs;
+ *   (2)  u32 eip;
+ * (2/1)  u16 entry_vector;
+ * (1/1)  u16 error_code;
+ * However, get_stack_top() acturally returns 20 bytes below the real
+ * top of the stack to allow space for:
+ * domain pointer, DS, ES, FS, GS. Therefore, we effectively skip 6 registers.
  */
 #define VMX_MONITOR_EFLAGS     0x202 /* IF on */
-#define NR_SKIPPED_REGS        4       /* See the above explanation */
+#define NR_SKIPPED_REGS        6       /* See the above explanation */
 #define VMX_SAVE_ALL_NOSEGREGS \
         pushl $VMX_MONITOR_EFLAGS; \
         popf; \